//
//  WatchCommandTool.h
//  Lightthings
//
//  Created by Hero on 2024/9/3.
//

#import <Foundation/Foundation.h>
#import "AlermModel.h"
#import "JYGlobalEnum.h"
#import <CoreBluetooth/CoreBluetooth.h>
NS_ASSUME_NONNULL_BEGIN

@interface WatchCommandTool : NSObject
SingletonH;

/* 步数 */
@property (nonatomic, assign) unsigned long  stepNum;
/* 卡路里 */
@property (nonatomic, assign) unsigned long calories;
/* 距离 */
@property (nonatomic, assign) unsigned long distance;
/* 心率 */
@property (nonatomic, assign) unsigned long heartRate;
/* 电量 */
@property (nonatomic, assign) unsigned long electric;


- (void)readStormCommand:(DeviceCommandEnum)type ToPeripheral:(CBPeripheral *)peripheral reBack:(void(^)(NSString *backData))bacdata;

- (void)writeStormCommand:(DeviceCommandEnum)type ToPeripheral:(CBPeripheral *)peripheral Value:(NSArray *)value reBack:(void(^)(NSString *backData))bacdata;

///  读取实时数据
/// - Parameter backBlock: 是否成功，  步数，卡路里 ， 距离，心率， 电量
- (void)readRealTimeDataFromPeripheral:(CBPeripheral *)peripheral Block:(void(^)(BOOL success, unsigned long stepData, unsigned long caloriesData, unsigned long distanceData , unsigned long heartRateData, unsigned long electricData))backBlock;

///  读取步数目标
/// - Parameter backBlock: 是否成功，  步数
- (void)readStepTargetData:(void(^)(BOOL success, unsigned long stepData))backBlock ToPeripheral:(CBPeripheral *)peripheral;

///  读取睡眠数据
/// - Parameter backBlock: 是否成功，  深睡眠  浅睡眠   日期
- (void)readSleepData:(void(^)(BOOL success, unsigned long deepSleepData, unsigned long lightSleepData, unsigned long dateData))backBlock ToPeripheral:(CBPeripheral *)peripheral;
///  读取血压数据
/// - Parameter backBlock: 是否成功，<日期  收缩压  舒张压>
- (void)readBloodPressureData:(void(^)(BOOL success, NSArray  *list))backBlock ToPeripheral:(CBPeripheral *)peripheral;

///  读取血氧数据
/// - Parameter backBlock: 是否成功，  最新数据   所有数据
- (void)readBloodOxygenData:(void(^)(BOOL success,  NSArray * allData))backBlock ToPeripheral:(CBPeripheral *)peripheral;


/// 读取 运动数据
/// - Parameter backBlock: 是否成功  类型  开始时间 运动时间  步数  卡路里  距离  心率
- (void)readSportData:(void(^)(BOOL success, NSArray<NSArray *> *allData))backBlock ToPeripheral:(CBPeripheral *)peripheral;

///  更改闹钟
- (void)writeAlermInfo:(AlermModel *)model CallBack:(void(^)(BOOL success))backBlock ToPeripheral:(CBPeripheral *)peripheral;
/// 更新时间
- (void)updateDateAndTimeCallBack:(void(^)(BOOL success))backBlock ToPeripheral:(CBPeripheral *)peripheral;

@end

NS_ASSUME_NONNULL_END
